bitkeeper revision 1.1159.1.442 (41a1d10dbSYVvRxFN616mDsOZFOL0Q)
authorcl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Mon, 22 Nov 2004 11:44:13 +0000 (11:44 +0000)
committercl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Mon, 22 Nov 2004 11:44:13 +0000 (11:44 +0000)
processor.h, fault.c:
  Make cur_pgd percpu.

linux-2.6.9-xen-sparse/arch/xen/i386/mm/fault.c
linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/processor.h

index b8d7e466a8006cf6c92a6162d970d2d98e8b0e49..99d3563f6451f825283f6ae7ba44a5d5dbd2d778 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/vt_kern.h>             /* For unblank_screen() */
 #include <linux/highmem.h>
 #include <linux/module.h>
+#include <linux/percpu.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -29,7 +30,7 @@
 
 extern void die(const char *,struct pt_regs *,long);
 
-pgd_t *cur_pgd;                        /* XXXsmp */
+DEFINE_PER_CPU(pgd_t *, cur_pgd);
 
 /*
  * Unlock any spinlocks which will prevent us from getting the
@@ -453,7 +454,8 @@ no_context:
        printk(" at virtual address %08lx\n",address);
        printk(KERN_ALERT " printing eip:\n");
        printk("%08lx\n", regs->eip);
-       page = ((unsigned long *) cur_pgd)[address >> 22];
+       page = ((unsigned long *) per_cpu(cur_pgd, smp_processor_id()))
+           [address >> 22];
        printk(KERN_ALERT "*pde = ma %08lx pa %08lx\n", page, machine_to_phys(page));
        /*
         * We must not directly access the pte in the highpte
@@ -526,7 +528,7 @@ vmalloc_fault:
                pmd_t *pmd, *pmd_k;
                pte_t *pte_k;
 
-               pgd = index + cur_pgd;
+               pgd = index + per_cpu(cur_pgd, smp_processor_id());
                pgd_k = init_mm.pgd + index;
 
                if (!pgd_present(*pgd_k))
index e1aaf0020f2f956704c0454982272308f1ebdf7d..83b75d4aeff5cc52476c0d982b630237a8feac2e 100644 (file)
@@ -87,7 +87,7 @@ extern struct cpuinfo_x86 boot_cpu_data;
 extern struct cpuinfo_x86 new_cpu_data;
 extern struct tss_struct doublefault_tss;
 DECLARE_PER_CPU(struct tss_struct, init_tss);
-extern pgd_t *cur_pgd;         /* XXXsmp */
+DECLARE_PER_CPU(pgd_t *, cur_pgd);
 
 #ifdef CONFIG_SMP
 extern struct cpuinfo_x86 cpu_data[];
@@ -183,7 +183,7 @@ static inline unsigned int cpuid_edx(unsigned int op)
 
 #define load_cr3(pgdir) do {                           \
        queue_pt_switch(__pa(pgdir));                   \
-       cur_pgd = pgdir;        /* XXXsmp */            \
+       per_cpu(cur_pgd, smp_processor_id()) = pgdir;   \
 } while (/* CONSTCOND */0)